*****************************************************************************************************************
** Reproduction code for "Sympathies for Putin within the German public: A consequence of political alienation? *
** Lucca Hoffeller / Goethe University Frankfurt, Germany / Chair of Comparative Politics						*
** Nils D. Steiner / Johannes Gutenberg University (JGU) Mainz, Germany / Group of Comparative Politics     	*
*****************************************************************************************************************

/*
Instructions:
This do-file reproduces all findings reported in the article listed above.
To reproduce the findings, do the following
1. Install ados and graph schemes used (if necessary), as follows
	ssc install estout
	ssc install coefplot
	ssc install fre
	net install grc1leg, from( http://www.stata.com/users/vwiggins/) 
	net install spost13_ado, replace 	// contains command fitstat
	ssc install schemepack, replace all
	
2. Obtain the datasets used directly from GESIS   
	GLES Panel 2016-2021, waves 1-21 (version 6.0.0): https://doi.org/10.4232/1.14114
	GLES Panel 2022, wave 22 (version 1.0.0): https://doi.org/10.4232/1.13970
	GLES Panel 2022, wave 23 (version 1.0.0): https://doi.org/10.4232/1.14064
	GLES Panel 2023, wave 24 (version 1.0.0): https://doi.org/10.4232/1.14141
3. Merge GLES Panel 2016-2021, waves 1-21: Combine files to one dataset for sample "A" following the instructions from GESIS. Run do-file from GESIS on this dataset to define missing values. 
4. Run do-file from GESIS on the other three datasets for the indvidual waves to define missing values. 
5. Merge the datasets for the individual waves to the dataset for waves 1-21 using the personal identifier "lfdn"
	For example:
	use ZA6838_allwaves_sA_v6-0-0_W1-21_mv.dta
	merge 1:1 lfdn using ZA7728_v1-0-0_mv.dta
	merge 1:1 lfdn using ZA7729_v1-0-0_mv.dta
	merge 1:1 lfdn using ZA7730_v1-0-0_mv.dta
6. Run the code below on the combined dataset
*/


*** General settings
	clear all
	set maxvar 25000
	set more off, perm
	version 18.0
	set scheme white_tableau	
	graph set window fontface "Times New Roman"
	
	
*** Open combined dataset (with missing values declared)
	use "Dataset_GLES_Panel_W1-W24_mv.dta"

	
*** Change working directory to output subfolder (must be created first)
	cd "Output"



**# Bookmark #1
********************************************************************************	
********************************* RECODING *************************************
********************************************************************************	
		
***** Survey set the data (with the weight wei21_mz) ****
	 svyset [pweight=wei21_mz]
	  

*** Multiply weight (to use as fweights, where only integer values are accepted)
	gen wei21_mz_mult=100000000*wei21_mz

		
***** Attitudes towards Putin and Russia *****
	** Rating scale Putin
	foreach x of numlist 21 22 23 24 { 
	fre kp`x'_1484d
	gen Putin_rating`x'=kp`x'_1484d-6
	label values Putin_rating`x' RatingIncr
	recode Putin_rating`x' (-5/-1=0) (0/5=1), gen(Putin_rating_bin`x')
	recode Putin_rating`x' (-5/0=0) (1/5=1), gen(Putin_rating_binstr`x')
	}
	
	label variable Putin_rating21 "Putin rating (wave 21)"
	
	** Difference in Putin rating
	gen Putin_rating_diff24vs21=Putin_rating24-Putin_rating21
	gen Putin_rating_diff23vs21=Putin_rating23-Putin_rating21
	gen Putin_rating_diff22vs21=Putin_rating22-Putin_rating21
	
	
	** Rating scale Russia 
	foreach x of numlist 21 22 23 24 { 
	fre kp`x'_1484c
	gen Russia_rating`x'=kp`x'_1484c-6
	label values Russia_rating`x' RatingIncr
	recode Russia_rating`x' (-5/-1=0) (0/5=1), gen(Russia_rating_bin`x')
	}

	label variable Russia_rating21 "Russia rating (wave 21)"
	
	** Difference in Russia rating
	gen Russia_rating_diff24vs21=Russia_rating24-Russia_rating21
	gen Russia_rating_diff23vs21=Russia_rating23-Russia_rating21
	gen Russia_rating_diff22vs21=Russia_rating22-Russia_rating21
	
	
	** The federal government should seek to maintain a good relationship with Vladimir Putin.
	foreach x of numlist 2 22 23 { 
	fre kp`x'_2880m
	gen Putin_relationship`x'=kp`x'_2880m-1
	label values Putin_relationship`x' FiveScaleIncr
	}	

	** Less cooperation, more confrontation with Russia (reversed)
	foreach x of numlist 16 22 23 24 { 
	fre kp`x'_2880bk
	gen Russia_coop`x'=kp`x'_2880bk-1
	label values Russia_coop`x' FiveScaleIncr
	}

	** Germany should accept the annexation of Crimea by Russia for the time being.
	foreach x of numlist 5 6 7 8 22 23 { 
	fre kp`x'_2880z
	gen Crimea`x'=kp`x'_2880z-1
	label values Crimea`x' FiveScaleIncr
	}	

	** Germany should accept the annexation of Crimea by Russia for the time being.
	foreach x of numlist 21 22 23 { 
	fre kp`x'_2880an1 
	gen Nordstream`x'=kp`x'_2880an1 -1
	label values Nordstream`x' FiveScaleIncr
	}	
	

***** Political alienation *****
	***** Lack of political trust
		** Trust in parliament (kpX_160a)
		label define trust 0 "do not trust at all" 2 "partly trust" 4 "trust fully"

		foreach x of numlist 21 23 { 
			gen trust_parl`x'= kp`x'_160a-1
			label values trust_parl`x' trust
			}		

		** Trust in public broadcasting (kpX_160p1)
		foreach x of numlist 21 23 { 
			gen trust_pubbroad`x'= kp`x'_160p1-1
			label values trust_pubbroad`x' trust
			}	
		
		** Trust in constitutional court (kp24_160b)
		foreach x of numlist 21 23 { 
			gen trust_court`x'= kp`x'_160b-1
			label values trust_court`x' trust
			}	
		
		** Political distrust -> index
		foreach x of numlist 21 23 { 
			factor trust_parl`x' trust_pubbroad`x' trust_court`x', pcf
			alpha trust_parl`x' trust_pubbroad`x' trust_court`x'
			gen poldistrust`x'= ((trust_parl`x'+trust_pubbroad`x'+trust_court`x')/3)/-4+1
			label variable poldistrust`x' "Lack of political trust"
			}			

			
	***** Lack of support for democracy (kpX_060e)
	foreach x of numlist 21 23 { 
		gen dictatorship`x'= (kp`x'_060e-1)/4
		label variable dictatorship`x' "Lack of support for democracy"
		}		


	***** Alienation from public discourse ("People like me are no longer allowed to freely express their opinions in public") 
	foreach x of numlist 17 23 { 
		gen opinion`x'=(kp`x'_080e-1)/4
		label variable opinion`x' "Alienation from public discourse"
		}		
		
		
	***** Conspiracy mentality
	foreach x of numlist 16 23 { 
		pwcorr kp`x'_030a kp`x'_030b kp`x'_030c kp`x'_030d [aweight=wei21_mz]
		factor kp`x'_030a kp`x'_030b kp`x'_030c kp`x'_030d [aweight=wei21_mz], pcf
		alpha kp`x'_030a kp`x'_030b kp`x'_030c kp`x'_030d
		gen conspment`x'=(((kp`x'_030a+kp`x'_030b+kp`x'_030c+kp`x'_030d)/4)-1)/6
		label variable conspment`x' "Conspiracy mentality"
		}	
	


***** Controls: Sociodemographic characteristics *****
	* Gender: Female
	recode kpx_2280 (1=0 "Male") (2=1 "Female"), gen(gender)
	
	* Education
	fre kp21_2320
	recode kp21_2320 (1 2=0 "Education: low") (3=1 "Education: middle") (4 5=2 "Education: high") (9=.), gen(education)
	
	* Age groups
	replace kpx_2290s="1955" if kpx_2290s=="1955 und frueher"
	destring kpx_2290s, gen(birthyear)
	gen age=2022-birthyear
	
	recode age (1/34=0 "Age: -34") (35/49=1 "Age: 35-49") (50/65=2 "Age: 50-65") (66/100=3 "Age: 66+"), gen(age_groups)
	
	* East vs. West Germany
	recode ostwest (0=1 "East") (1=0 "West"), gen(east)

	* Speaks Russian language at home
	fre kpx_4131o kp15_4131o kp16_4131o
	
	gen Russianspeaking=.
	replace Russianspeaking=0 if kpx_4131o==.c | kpx_4131o==0 
	replace Russianspeaking=1 if kpx_4131o==1 
	replace Russianspeaking=0 if Russianspeaking==. & (kp15_4131o==.c | kp15_4131o==0)
	replace Russianspeaking=1 if kp15_4131o==1
	replace Russianspeaking=0 if Russianspeaking==. & (kp16_4131o==.c | kp16_4131o==0)
	replace Russianspeaking=1 if kp16_4131o==1	 
	
	label variable Russianspeaking "Russian speaking"
	label define Russianspeaking 1 "Russian speaking" 0 "not Russian speaking"
	label values Russianspeaking Russianspeaking
	
	tab Russianspeaking

	* Russian migration background	
	fre kpx_3930 kpa2_3930 // (Own Country of Birth) 
	gen BornRussia_self=0 if kpx_3930==.c | (kpx_3930!=5 & kpx_3930<.)
	replace BornRussia_self=1 if kpx_3930==5
	replace BornRussia_self=0 if kpa2_3930==.c | (kpa2_3930!=5 & kpa2_3930<.)
	replace BornRussia_self=1 if kpa2_3930==5
	
	fre kpx_2572a kp15_2572a kp16_2572a // (Country of Birth Mother) 
	gen BornRussia_mother=0 if kpx_2572a==.c | (kpx_2572a!=5 & kpx_2572a<.)
	replace BornRussia_mother=1 if kpx_2572a==5
	replace BornRussia_mother=0 if kp15_2572a==.c | (kp15_2572a!=5 & kp15_2572a<.)
	replace BornRussia_mother=1 if kp15_2572a==5	
	replace BornRussia_mother=0 if kp16_2572a==.c | (kp16_2572a!=5 & kp16_2572a<.)
	replace BornRussia_mother=1 if kp16_2572a==5		
	
	fre kpx_2572b kp15_2572b kp16_2572b // (Country of Birth Father) 
	gen BornRussia_father=0 if kpx_2572b==.c | (kpx_2572b!=5 & kpx_2572b<.)
	replace BornRussia_father=1 if kpx_2572b==5
	replace BornRussia_father=0 if kp15_2572b==.c | (kp15_2572b!=5 & kp15_2572b<.)
	replace BornRussia_father=1 if kp15_2572b==5	
	replace BornRussia_father=0 if kp16_2572b==.c | (kp16_2572b!=5 & kp16_2572b<.)
	replace BornRussia_father=1 if kp16_2572b==5		
		
	gen Russianmigrant=0 if BornRussia_self==0 & BornRussia_mother==0 & BornRussia_father==0
	replace Russianmigrant=1 if BornRussia_self==1 | BornRussia_mother==1 | BornRussia_father==1
	
	tab Russianmigrant Russianspeaking
	

***** Controls: Foreign policy postures *****

	** Anti-atlanticism   		 
		* On foreign policy issues, Germany should act in harmony with the USA (kpX_1483c) (REVERSE) 
		foreach x of numlist 21 22 23 24 { 
			gen US_harmony`x'= (kp`x'_1483c -1)/-4+1
			}		
		
		* Germany should pursue its interests vis-a-vis the USA with more confidence 
		foreach x of numlist 21 22 23 24 { 
			gen US_owninterests`x'= (kp`x'_1483h-1)/4
			}		
		
		* Mean index
		foreach x of numlist 21 22 23 24 { 
			pwcorr US_harmony`x' US_owninterests`x' [aweight=wei21_mz]
			gen anti_atlanticism`x'=(US_harmony`x'+US_owninterests`x')/2
			label variable anti_atlanticism`x' "Anti-Atlanticism"
			}	
			
			
	** Pacifism  
		* Use of military force is never justified (kpX_1483a)
		foreach x of numlist 21 22 23 24 { 
			gen military_never`x'= (kp`x'_1483a -1)/4
			}			
		
		* War is sometimes necessary to protext a county's interests (REVERSE) 
		foreach x of numlist 21 22 23 24 { 
			gen war_necessary`x'= (kp`x'_1483f -1)/-4+1
			}	
			
		* Mean index
		foreach x of numlist 21 22 23 24 { 
			pwcorr military_never`x' war_necessary`x' [aweight=wei21_mz]
			gen pacifism`x'=(military_never`x'+war_necessary`x')/2
			label variable pacifism`x' "Pacifism"
			}	

			
	** Unilateralism 
		* In international crises, Germany and its allies should agree on a common position (kpX_1483d) (REVERSE)
		foreach x of numlist 21 22 23 24 { 
			gen commonposition`x'= (kp`x'_1483d -1)/-4+1
			}	
		
		* Germany should take care of its security primarily on its own 
		foreach x of numlist 21 22 23 24 { 
			gen onitsown`x'= (kp`x'_1483g -1)/4
			}	
			
		* Mean index
		foreach x of numlist 21 22 23 24 { 
			pwcorr commonposition`x' onitsown`x' [aweight=wei21_mz]
			gen unilateralism`x'=(commonposition`x'+ onitsown`x')/2
			label variable unilateralism`x' "Unilateralism"
			}	


	** Isolationism 
		* Germany should focus on its domestic problems (kpX_1483b)
		foreach x of numlist 21 22 23 24 { 
			gen domestic`x'= (kp`x'_1483b -1)/4
			}	

		* Germany should play a more active role in global politics (REVERSE)
		foreach x of numlist 21 22 23 24 { 
			gen active`x'= (kp`x'_1483e -1)/-4+1
			}	
		
		* Mean index
		foreach x of numlist 21 22 23 24 { 
			pwcorr domestic`x' active`x' [aweight=wei21_mz]
			gen isolationism`x'=(domestic`x'+ active`x')/2
			label variable isolationism`x' "Isolationism"
		}	

		
***** Controls: General political ideology *****
	
	* Authoritarian policy positions 
	clonevar migration_21=kp21_1130
	clonevar genderequal_17=kp17_1590
	clonevar climatechange_17=kp17_1290

	factor migration_21 genderequal_17 climatechange_17 [aweight=wei21_mz], pcf 
	predict authoritarian

	sum authoritarian
	gen authoritarian_st=(authoritarian-r(min))/(r(max)-r(min))
	
	label variable authoritarian_st "Authoritarian position"
	
	* Left-right self-placement 
	recode kp16_1500 (1 2 3=0 "Extreme left") (4 5=1 "Left") (6=2 "Center") (7 8=3 "Right") (9 10 11=4 "Extreme right"), gen(leftright16)
	
	* Party identification 
	recode kp21_2090a (1=1 "CDU/CSU") (4=4 "SPD") (5=5 "FDP") (6=6 "GRÜNE") (7=7 "DIE LINKE") (322=322 "AfD") (801=801 "another party") (808=808 "no party identification"), gen(partyid21)



**# Bookmark #2
********************************************************************************	
*************************** MAIN DESCRIPTIVES **********************************
********************************************************************************

**** Figure 2: Ratings of Putin in December 2021 and May 2023
	capture drop include	
	reg Putin_rating21 Putin_rating24 wei21_mz_mult
	gen include=1 if e(sample)
	
	hist Putin_rating21 if include==1 [fweight=wei21_mz_mult], discrete percent addlabopts(yvarformat(%2.1f) mlabsize(small)) ///
		scheme(white_tableau) ///
		xtitle("Rating of Putin in December 2021", size(medium)) ytitle("Percent", size(medium)) ///
		xlabel(-5/5, grid gmax) ///
		name(hist1, replace) nodraw
	
	hist Putin_rating24 if include==1 [fweight=wei21_mz_mult], discrete percent addlabopts(yvarformat(%2.1f) mlabsize(small)) ///
		scheme(white_tableau) ///
		xtitle("Rating of Putin in May 2023", size(medium)) ytitle("Percent", size(medium)) ///
		xlabel(-5/5, grid gmax) ///
		name(hist2, replace) nodraw
		
		graph combine hist1 hist2, xsize(8) ycommon iscale(*1.6) name(Figure2, replace)
		
		graph export Figure2.tif, width(1000) replace	
		graph export Figure2.eps, replace

	
	
***** Figure 3: Mean rating of Putin across waves and facets of political alienation 
	tab poldistrust21
	sum poldistrust21, d
	egen poldis_figure = cut(poldistrust21), at (0, .25, .75, 1) icodes 
	tab poldistrust21 poldis_figure
	label define lowhigh 0 "Low" 1 "Medium" 2 "High"
	label values poldis_figure lowhigh
		
	tab dictatorship21
	recode dictatorship21 (0/.25=0) (.5=1) (.75/1=2), gen(dictatorship_figure)	
	tab dictatorship21 dictatorship_figure
	label define agree 0 "Do not agree" 1 "Partly" 2 "Agree"
	label values dictatorship_figure agree
	
	tab conspment16
	sum conspment16, d
	egen consp_figure = cut(conspment16), at (0, .25, .75, 1) icodes 
	tab conspment16 consp_figure
	lab val consp_figure lowhigh

	tab opinion17
	recode opinion17 (0/.25=0) (.5=1) (.75/1=2), gen(opinion_figure)	
	tab opinion17 opinion_figure
	label values opinion_figure agree	



* Political distrust
preserve	
	keep if Putin_rating21<. & Putin_rating22<. & Putin_rating23<. & Putin_rating24<.
	reshape long Putin_rating, i(lfdn) j(wave)
	collapse (mean) Putin_rating [pweight=wei21_mz], by(poldis_figure wave)
	xtset poldis_figure wave
	xtline Putin_rating, overlay ytitle(" ", size(zero)) xtitle(" ", size(zero)) xlabel(21 "12/2021" 22 "05-06/2022" 23 "10-11/2022" 24 "5/2023  ") ylabel(-5/0, gmin gmax) ///
		legend(order(3 "alienation: high" 2 "alienation: medium" 1 "alienation: low") rows(1) pos(6) size(medsmall)) ///
		plot1(lcolor(navy)) plot2(lcolor(gs10)) plot3(lcolor(orange_red)) ///		
		title("Lack of political trust", size(medsmall)) ///
		name(poldistrust, replace) nodraw
restore

* Support for dictatorship
preserve
	keep if Putin_rating21<. & Putin_rating22<. & Putin_rating23<. & Putin_rating24<.
	reshape long Putin_rating, i(lfdn) j(wave)
	collapse (mean) Putin_rating [pweight=wei21_mz], by(dictatorship_figure wave)
	xtset dictatorship_figure wave
	xtline Putin_rating, overlay ytitle(" ", size(zero)) xtitle(" ", size(zero)) xlabel(21 "12/2021" 22 "05-06/2022" 23 "10-11/2022" 24 "5/2023  ") ylabel(-5/0, gmin gmax) ///
		legend(order(3 "alienation: high" 2 "alienation: medium" 1 "alienation: low") rows(1) pos(6) size(medsmall)) ///
		plot1(lcolor(navy)) plot2(lcolor(gs10)) plot3(lcolor(orange_red)) ///			
		title("Lack of support for democracy", size(medsmall)) ///
		name(dictatorship, replace) nodraw
restore

* Conspiracy mentality
preserve
	keep if Putin_rating21<. & Putin_rating22<. & Putin_rating23<. & Putin_rating24<.
	reshape long Putin_rating, i(lfdn) j(wave)
	collapse (mean) Putin_rating [pweight=wei21_mz], by(consp_figure wave)
	xtset consp_figure wave
	xtline Putin_rating, overlay ytitle(" ", size(zero)) xtitle(" ", size(zero)) xlabel(21 "12/2021" 22 "05-06/2022" 23 "10-11/2022" 24 "5/2023  ") ylabel(-5/0, gmin gmax) ///
		legend(order(3 "alienation: high" 2 "alienation: medium" 1 "alienation: low") rows(1) pos(6) size(medsmall)) ///
		plot1(lcolor(navy)) plot2(lcolor(gs10)) plot3(lcolor(orange_red)) ///			
		title("Conspiracy mentality", size(medsmall)) /// 
		name(consp, replace) nodraw
restore


* Alienation from public discourse
preserve	
	keep if Putin_rating21<. & Putin_rating22<. & Putin_rating23<. & Putin_rating24<.
	reshape long Putin_rating, i(lfdn) j(wave)
	collapse (mean) Putin_rating [pweight=wei21_mz], by(opinion_figure wave)
	xtset opinion_figure wave
	xtline Putin_rating, overlay ytitle(" ", size(zero)) xtitle(" ", size(zero)) xlabel(21 "12/2021" 22 "05-06/2022" 23 "10-11/2022" 24 "5/2023  ") ylabel(-5/0, gmin gmax) ///
		legend(order(3 "alienation: high" 2 "alienation: medium" 1 "alienation: low") rows(1) pos(6) size(medsmall)) ///
		plot1(lcolor(navy)) plot2(lcolor(gs10)) plot3(lcolor(orange_red)) ///			
		title("Alienation from public discourse", size(medsmall)) ///
		name(opinion, replace) nodraw
restore		
	
* Combine graphs
	grc1leg poldistrust dictatorship opinion consp , ///
		ycommon imargin(small) iscale(*1.6) name(Figure3, replace)			
		
		graph export Figure3.tif, width(1000) replace	
		graph export Figure3.eps, replace	
		
		
		
**# Bookmark #3
********************************************************************************	
*************************** DESCRIPTIVES FOR APPENDIX **************************
********************************************************************************
	
***** Figure A1: Histograms of change in Putin rating (May 2023 vs. December 2021) 
	hist Putin_rating_diff24vs21 [fweight=wei21_mz_mult], discrete percent addlabopts(yvarformat(%4.1f) mlabsize(small)) scale(*1.2) xtitle("Difference in rating of Putin") name(FigureA1, replace)

		graph export FigureA1.tif, width(1000) replace	
		
		
***** Figure A2: Scatterplot of Putin rating in December 2021 and May 2023 	
	twoway (scatter Putin_rating24 Putin_rating21 if include==1 , msymbol(.) msize(tiny) jitter(4)) ///
		(qfit Putin_rating24 Putin_rating21), legend(off) ytitle("Rating of Putin in May 2023", size(medlarge)) xtitle("Rating of Putin in December 2021", size(medlarge)) ///
		xlabel(-5/5, grid gmax) ylabel(-5/5, grid gmax)  ///
		scheme(white_tableau) ///
		name(FigureA2, replace) 
		
		graph export FigureA2.tif, width(1000) replace	
	
		
***** Figure A3: Mean rating of RUSSIA across waves and facets of political alienation 

* Political distrust
preserve
	keep if Russia_rating21<. & Russia_rating22<. & Russia_rating23<. & Russia_rating24<.
	reshape long Russia_rating, i(lfdn) j(wave)
	collapse (mean) Russia_rating [pweight=wei21_mz], by(poldis_figure wave)
	xtset poldis_figure wave
	list poldis_figure wave Russia_rating
	xtline Russia_rating, overlay ytitle(" ", size(zero)) xtitle(" ", size(zero)) xlabel(21 "12/2021" 22 "05-06/2022" 23 "10-11/2022" 24 "5/2023  ") ylabel(-5/0, gmin gmax) ///
		legend(order(3 "alienation: high" 2 "alienation: medium" 1 "alienation: low") rows(1) pos(6) size(medsmall)) ///
		plot1(lcolor(navy)) plot2(lcolor(gs10)) plot3(lcolor(orange_red)) ///					
		title("Lack of political trust", size(medsmall)) ///
		name(poldistrust, replace) nodraw
restore


* Support for dictatorship
preserve	
	keep if Russia_rating21<. & Russia_rating22<. & Russia_rating23<. & Russia_rating24<.
	reshape long Russia_rating, i(lfdn) j(wave)
	collapse (mean) Russia_rating [pweight=wei21_mz], by(dictatorship_figure wave)
	xtset dictatorship_figure wave
	xtline Russia_rating, overlay ytitle(" ", size(zero)) xtitle(" ", size(zero)) xlabel(21 "12/2021" 22 "05-06/2022" 23 "10-11/2022" 24 "5/2023  ") ylabel(-5/0, gmin gmax) ///
		legend(order(3 "alienation: high" 2 "alienation: medium" 1 "alienation: low") rows(1) pos(6) size(medsmall)) ///
		plot1(lcolor(navy)) plot2(lcolor(gs10)) plot3(lcolor(orange_red)) ///		
		title("Lack of support for democracy", size(medsmall)) ///
		name(dictatorship, replace) nodraw
restore

* Conspiracy mentality
preserve
	keep if Russia_rating21<. & Russia_rating22<. & Russia_rating23<. & Russia_rating24<.
	reshape long Russia_rating, i(lfdn) j(wave)
	collapse (mean) Russia_rating [pweight=wei21_mz], by(consp_figure wave)
	xtset consp_figure wave
	xtline Russia_rating, overlay ytitle(" ", size(zero)) xtitle(" ", size(zero)) xlabel(21 "12/2021" 22 "05-06/2022" 23 "10-11/2022" 24 "5/2023  ") ylabel(-5/0, gmin gmax) ///
		legend(order(3 "alienation: high" 2 "alienation: medium" 1 "alienation: low") rows(1) pos(6) size(medsmall)) ///
		plot1(lcolor(navy)) plot2(lcolor(gs10)) plot3(lcolor(orange_red)) ///		
		title("Conspiracy mentality", size(medsmall)) ///
		name(consp, replace) nodraw
restore


* Alienation from public discourse
preserve	
	keep if Russia_rating21<. & Russia_rating22<. & Russia_rating23<. & Russia_rating24<.
	reshape long Russia_rating, i(lfdn) j(wave)
	collapse (mean) Russia_rating [pweight=wei21_mz], by(opinion_figure wave)
	xtset opinion_figure wave
	xtline Russia_rating, overlay ytitle(" ", size(zero)) xtitle(" ", size(zero)) xlabel(21 "12/2021" 22 "05-06/2022" 23 "10-11/2022" 24 "5/2023  ") ylabel(-5/0, gmin gmax) ///
		legend(order(3 "alienation: high" 2 "alienation: medium" 1 "alienation: low") rows(1) pos(6) size(medsmall)) ///
		plot1(lcolor(navy)) plot2(lcolor(gs10)) plot3(lcolor(orange_red)) ///		 
		title("Alienation from public discourse", size(medsmall)) ///
		name(opinion, replace) nodraw
restore		
	
* Combine graphs
	grc1leg poldistrust dictatorship opinion consp , ///
		ycommon imargin(small) iscale(*1.6) name(FigureA3, replace)			
		
		graph export FigureA3.tif, width(1000) replace	
		
	
***** Tables A2: Pairwise correlations between political alienation variables
	pwcorr poldistrust21 dictatorship21 conspment16 opinion17 [aweight=wei21_mz]
	
	
***** Table A3: Factor analysis with measures of political alienation
	factor poldistrust21 dictatorship21 opinion17 conspment16 [aweight=wei21_mz], pcf
	predict polallienation21

		alpha poldistrust21 dictatorship21 opinion17 conspment16 
	
	sum polallienation21
	gen polallienation21_st=(polallienation-r(min))/(r(max)-r(min))
		
	label variable polallienation21_st "Political alienation (factor)"
	
	
***** Figure A4: Histograms of political alienation variables 
	* pre-invasion
	hist poldistrust21 [fweight=wei21_mz_mult], bin(10) percent addlabopts(yvarformat(%4.1f) mlabsize(small)) name(hist_distrust, replace) nodraw

	hist dictatorship21 [fweight=wei21_mz_mult], discrete percent addlabopts(yvarformat(%4.1f) mlabsize(small)) name(hist_dictatorship, replace) nodraw

	hist conspment16 [fweight=wei21_mz_mult], bin(10) percent addlabopts(yvarformat(%4.1f) mlabsize(small)) name(hist_conspment, replace) nodraw

	hist opinion17 [fweight=wei21_mz_mult], discrete percent addlabopts(yvarformat(%4.1f) mlabsize(small)) name(hist_opinion, replace) nodraw

	hist polallienation21_st [fweight=wei21_mz_mult], bin(10) percent addlabopts(yvarformat(%4.1f) mlabsize(small)) name(hist_factor, replace) nodraw
	
	graph combine hist_distrust hist_dictatorship hist_opinion hist_conspment hist_factor, imargin(small) row(3) iscale(*0.9) name(FigureA4, replace) ysize(6)

		graph export FigureA4.tif, width(1000) replace			

	
	
**# Bookmark #4	
*********************************************************************************
*************************** MAIN REGRESSIONS ************************************
*********************************************************************************	
	
***** Figure 4: Regressing ratings of Putin in May 2023 on pre-invasion attitudes
* OLS
	* Model 1
	reg Putin_rating24 poldistrust21 dictatorship21 opinion17 conspment16 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz], robust		
		eststo Putin_m1
		
	* Model 2
	reg Putin_rating24 polallienation21_st i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz], robust		
		eststo Putin_m2
		
* Logit
	* Model 1
	logit Putin_rating_bin24 poldistrust21 dictatorship21 opinion17 conspment16 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz], robust		
		fitstat
		margins, dydx(*) post
		eststo Putin_bin_m1	
		
	* Model 2
	logit Putin_rating_bin24 polallienation21_st i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz], robust		
		fitstat

		sum polallienation21_st if e(sample), d

		* predicted probabilities of Putin friendly view for extreme cases
		margins, at(polallienation21_st=(0))
			// 0.025
		margins, at(polallienation21_st=(1))
			// 0.50	
		
		* predicted probabilities of Putin friendly view for 10th, 50th and 90th percentile values
		margins, at(polallienation21_st=(.0748849 .3134125 .638885))
			// 0.033
			// 0.079
			// 0.221

		margins, dydx(*) post
		eststo Putin_bin_m2
			
* Plot
	coefplot Putin_m1 Putin_m2, bylabel("OLS: coefficients") || Putin_bin_m1 Putin_bin_m2, bylabel("Logit: AMEs") ||, ///
			drop(_cons) xline(0) level(95 90) byopts(row(1) xrescale)  ///
			scheme(white_tableau) ///
			legend(cols(15) hole(1 2 3 4 5 6 7 8 11 12 13) order(3 "R²=0.24" 6 "R²=0.23" 3 "Pseudo-R²=0.39" 6 "Pseudo-R²=0.38")) ///
			order(poldistrust21 dictatorship21 opinion17 conspment16 polallienation21_st) ///
			name(Figure4, replace)	
			
	graph export Figure4.tif, width(1000) replace		
	graph export Figure4.eps, replace	
	


***** Figure 5: Regressing change in ratings of Putin between December 2021 and May 2023 on pre-invasion attitudes 
	* OLS
	* Model 1
	reg Putin_rating_diff24vs21 c.Putin_rating21##c.Putin_rating21 poldistrust21 dictatorship21 opinion17 conspment16 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz]
		eststo dPutin_m1
	
	* Model 2
	reg Putin_rating_diff24vs21 c.Putin_rating21##c.Putin_rating21 polallienation21_st i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz] 
		eststo dPutin_m2

				sum polallienation21_st if e(sample), d
		
		* predicted changes for extreme cases
		margins, at(polallienation21_st=(0))
			// -2.21
		margins, at(polallienation21_st=(1))
			// -0.10	

		* predicted change of Putin friendly view for 10th, 50th and 90th percentile values
		margins, at(polallienation21_st=(.0748848 .3124289 .6383951))
			// -2.05
			// -1.55
			// -0.86
			
	* Plot
	coefplot dPutin_m1 dPutin_m2, bylabel("OLS: coefficients") ||, ///
			drop(_cons) xline(0) level(95 90) byopts(row(1) xrescale)  ///
			scheme(white_tableau) ///
			legend(order(3 "R²=0.48" 6 "R²=0.47")) ///
			order(poldistrust21 dictatorship21 opinion17 conspment16 polallienation21_st) ///
			name(Figure5, replace)	
			
	graph export Figure5.tif, width(1000) replace	
	graph export Figure5.eps, replace	
			
	
	* For footnote:
		* Model 1 with only alienation from public discourse
		reg Putin_rating_diff24vs21 c.Putin_rating21##c.Putin_rating21 opinion17 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz]	
	
		* Model 1 with only lack of support for democracy
		reg Putin_rating_diff24vs21 c.Putin_rating21##c.Putin_rating21 dictatorship21 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz]
	
	
	
**# Bookmark #5	
*********************************************************************************
*************************** ROBUSTNESS REGRESSIONS ******************************
*********************************************************************************	
	
***** Appendix B: Socio-demographic model *****

***** Figure B1: Predicting ratings of Putin in May 2023 with only socio-demographic variables
	capture drop include
	reg Putin_rating24 poldistrust21 dictatorship21 opinion17 conspment16 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz], robust		
	gen include=1 if e(sample)
	
	* OLS
	reg Putin_rating24 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking if include==1 [pweight=wei21_mz], robust		
		eststo Putin_m0			
	
		* predicted value by age and East/West (not shown, just for interpretation)
		margins, at(age_groups=(0 1 2 3) east=(0 1))
		marginsplot, name(predbyageEastWest, replace)
	
	* Logit
	logit Putin_rating_bin24 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking if include==1 [pweight=wei21_mz], robust
		fitstat
		margins, dydx(*) post
		eststo Putin_bin_m0	
	
	* Plot
	coefplot Putin_m0, bylabel("OLS: coefficients [R²=0.06]") || Putin_bin_m0, bylabel("Logit: AMEs [Pseudo-R²=0.10]") ||, ///
			drop(_cons ) xline(0) level(95 90) byopts(row(1) xrescale) ///
			scheme(white_tableau) ///
			legend(order(1 "" 2 "Pseudo-R²=0.10" 3 "R²=0.06" 4 "")) ///
			name(FigureB1, replace) nodraw
	
	graph combine FigureB1, iscale(*1.2) name(FigureB1, replace)
	
	graph export FigureB1.tif, width(1000) replace	
	

	
***** Appendix C: Binary-logistic regressions of ratings of Putin in May 2023 on pre-invasion attitudes with stricter definition of pro-Putin attitude *****
	
*** Figure C1:  Binary-logistic regressions of attitudes towards Putin in May 2023 with higher threshold for pro-Putin attitude (>=6) 
		
* Logit
	* Model 1
	logit Putin_rating_binstr24 poldistrust21 dictatorship21 opinion17 conspment16 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz], robust		
		fitstat

		margins, dydx(*) post
		eststo Putin_bin_m1
		
	* Model 2
	logit Putin_rating_binstr24 polallienation21_st i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz], robust		
		fitstat

		sum polallienation21_st if e(sample), d
		
		* predicted probabilities of Putin friendly view for extreme cases
		margins, at(polallienation21_st=(0))
			// 0.011
		margins, at(polallienation21_st=(1))
			// 0.268	
		
		margins, dydx(*) post
		eststo Putin_bin_m2		
			
* Plot
	coefplot Putin_bin_m1 Putin_bin_m2, bylabel("OLS: coefficients") ||, ///
			drop(_cons) xline(0) level(95 90) byopts(row(1) xrescale)  ///
			scheme(white_tableau) ///
			legend(order(3 "R²=0.41" 6 "R²=0.41")) ///
			order(poldistrust21 dictatorship21 opinion17 conspment16 polallienation21_st) ///
			name(FigureC1, replace)	
			
	graph export FigureC1.tif, width(1000) replace	

	
	
***** Appendix D: Predicting attitudes towards Putin regime and Russia *****

*** Table D1:  Factor analysis of Pro-Putin/pro-Russian attitudes in wave 23 (October-November 2022)
	**** Factor analyses 
	factor Putin_rating23 Russia_rating23 Putin_relationship23 Russia_coop23 Crimea23 Nordstream23 [aweight=wei21_mz], pcf
	predict proRussian23
	
		pwcorr Putin_rating23 Russia_rating23 Putin_relationship23 Russia_coop23 Crimea23 Nordstream23 [aweight=wei21_mz]
		alpha Putin_rating23 Russia_rating23 Putin_relationship23 Russia_coop23 Crimea23 Nordstream23
	
	* rescale from 0 to 10 (as Putin rating)
	sum proRussian23
	gen proRussian23_st=(proRussian23-r(min))/(r(max)-r(min))*10
	sum proRussian23_st	
	
	* binary measure
	gen proRussian23_bin=0 if proRussian23_st<5.5
	replace proRussian23_bin=1 if proRussian23_st>=5.5 & proRussian23_st<.
	fre Putin_rating_bin23 proRussian23_bin
	tab Putin_rating_bin23 proRussian23_bin

	
***** Figure D1: Regressing attitudes towards Putin regime (factor) in October-November 2022 on pre-invasion attitudes
* OLS
	* Model 1
	reg proRussian23_st poldistrust21 dictatorship21 opinion17 conspment16 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz], robust	
		eststo Factor_m1

	* Model 2
	reg proRussian23_st polallienation21_st i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz], robust		
		eststo Factor_m2

* Plot
	coefplot Factor_m1 Factor_m2, bylabel("OLS: coefficients") ||, ///
			drop(_cons *Putin_rating21 Putin_rating_bin21) xline(0) level(95 90) byopts(row(1) xrescale)  ///
			scheme(white_tableau) ///
			legend(order(3 "R²=0.33" 6 "R²=0.32")) ///
			order(poldistrust21 dictatorship21 opinion17 conspment16 polallienation21_st) ///
			name(FigureD1, replace)	
			
	graph export FigureD1.tif, width(1000) replace	
		
		


***** Figure D2: Predicting change in ratings of Russia between December 2021 and May 2023 
	* OLS
	* Model 1
	reg Russia_rating_diff24vs21 c.Russia_rating21##c.Russia_rating21 poldistrust21 dictatorship21 opinion17 conspment16 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz] 
		eststo dRussia_m1
	
	* Model 2
	reg Russia_rating_diff24vs21 c.Russia_rating21##c.Russia_rating21 polallienation21_st i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16	[pweight=wei21_mz] 
		eststo dRussia_m2
	
	* Plot
	coefplot dRussia_m1 dRussia_m2, bylabel("OLS: coefficients") ||, ///
			drop(_cons) xline(0) level(95 90) byopts(row(1) xrescale)  ///
			scheme(white_tableau) ///
			legend(order(3 "R²=0.37" 6 "R²=0.37")) ///
			order(poldistrust21 dictatorship21 opinion17 conspment16 polallienation21_st) ///
			name(FigureD2, replace)	
			
	graph export FigureD2.tif, width(1000) replace	
	
	

***** Appendix E: Predicting change in ratings of Putin between December 2021 and May 2023 with additional controls for party identification *****

***** Figure E1: Predicting change in ratings of Putin between December 2021 and May 2023 with additional controls for party identification 
	* OLS
	* Model 1
	reg Putin_rating_diff24vs21 c.Putin_rating21##c.Putin_rating21 poldistrust21 dictatorship21 opinion17 conspment16 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16	ib808.partyid21 [pweight=wei21_mz] 
		eststo dPutin_m1_PID
	
	* Model 2
	reg Putin_rating_diff24vs21 c.Putin_rating21##c.Putin_rating21 polallienation21_st i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 ib808.partyid21 [pweight=wei21_mz] 
		eststo dPutin_m2_PID
		
	* Plot
	coefplot dPutin_m1_PID dPutin_m2_PID, bylabel("OLS: coefficients") ||, ///
			drop(_cons) xline(0) level(95 90) byopts(row(1) xrescale)  ///
			scheme(white_tableau) ///
			legend(order(3 "R²=0.49" 6 "R²=0.48")) ///
			order(poldistrust21 dictatorship21 opinion17 conspment16 polallienation21_st) ///
			name(FigureE1, replace)	
			
	graph export FigureE1.tif, width(1000) replace			
		
	

***** Appendix F: Regressions of attitudes towards Putin in different waves  *****

***** Figure F1: Predicting ratings of Putin in May-July 2022 with pre-invasion measures
*** OLS
	* Model 1
	reg Putin_rating22 poldistrust21 dictatorship21 opinion17 conspment16 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz], robust		
		eststo Putin_m1		

	* Model 2
	reg Putin_rating22 polallienation21_st i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz], robust		
		eststo Putin_m2

*** Logit
	* Model 1
	logit Putin_rating_bin22 poldistrust21 dictatorship21 opinion17 conspment16 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking  anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz], robust	
		fitstat
		margins, dydx(*) post
		eststo Putin_bin_m1

	* Model 2
	logit Putin_rating_bin22 polallienation21_st i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz], robust	
		fitstat
		margins, dydx(*) post
		eststo Putin_bin_m2

	* Plot
	coefplot Putin_m1 Putin_m2, bylabel("OLS: coefficients") || Putin_bin_m1 Putin_bin_m2, bylabel("Logit: AMEs") ||, ///
			drop(_cons *Putin_rating21 Putin_rating_bin21) xline(0) level(95 90) byopts(row(1) xrescale)  ///
			scheme(white_tableau) ///
			legend(cols(15) hole(1 2 3 4 5 6 7 8 11 12 13) order(3 "R²=0.20" 6 "R²=0.20" 3 "Pseudo-R²=0.34" 6 "Pseudo-R²=0.34")) ///
			order(poldistrust21 dictatorship21 opinion17 conspment16 polallienation21_st) ///
			name(FigureF1, replace)	
			
	graph export FigureF1.tif, width(1000) replace	
	
				
***** Figure F2: Predicting change in ratings of Putin between December 2021 and May-July 2022 
	* OLS
	* Model 1
	reg Putin_rating_diff22vs21 c.Putin_rating21##c.Putin_rating21 poldistrust21 dictatorship21 opinion17 conspment16 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16	[pweight=wei21_mz]
		eststo dPutin_m1
	
	* Model 2
	reg Putin_rating_diff22vs21 c.Putin_rating21##c.Putin_rating21 polallienation21_st i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz] 
		eststo dPutin_m2

	* Plot
	coefplot dPutin_m1 dPutin_m2, bylabel("OLS: coefficients") ||, ///
			drop(_cons) xline(0) level(95 90) byopts(row(1) xrescale)  ///
			scheme(white_tableau) ///
			legend(order(3 "R²=0.45" 6 "R²=0.45")) ///
			order(poldistrust21 dictatorship21 opinion17 conspment16 polallienation21_st) ///
			name(FigureF2, replace)	
			
	graph export FigureF2.tif, width(1000) replace	
		
		
		
***** Figure F3: Predicting ratings of Putin in May-July 2022 with pre-invasion measures
*** OLS
	* Model 1
	reg Putin_rating23 poldistrust21 dictatorship21 opinion17 conspment16 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz], robust	
		eststo Putin_m1		

	* Model 2
	reg Putin_rating23 polallienation21_st i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz], robust		
		eststo Putin_m2

*** Logit
	* Model 1
	logit Putin_rating_bin23 poldistrust21 dictatorship21 opinion17 conspment16 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz], robust	
		fitstat
		margins, dydx(*) post
		eststo Putin_bin_m1

	* Model 2
	logit Putin_rating_bin23 polallienation21_st i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz], robust	
		fitstat
		margins, dydx(*) post
		eststo Putin_bin_m2

	* Plot
	coefplot Putin_m1 Putin_m2, bylabel("OLS: coefficients") || Putin_bin_m1 Putin_bin_m2, bylabel("Logit: AMEs") ||, ///
			drop(_cons *Putin_rating21 Putin_rating_bin21) xline(0) level(95 90) byopts(row(1) xrescale)  ///
			scheme(white_tableau) ///
			legend(cols(15) hole(1 2 3 4 5 6 7 8 11 12 13) order(3 "R²=0.23" 6 "R²=0.23" 3 "Pseudo-R²=0.38" 6 "Pseudo-R²=0.37")) ///
			order(poldistrust21 dictatorship21 opinion17 conspment16 polallienation21_st) ///
			name(FigureF3, replace)	
			
	graph export FigureF3.tif, width(1000) replace	
	
				
***** Figure F4: Predicting change in ratings of Putin between December 2021 and May-July 2022 
	* OLS
	* Model 1
	reg Putin_rating_diff23vs21 c.Putin_rating21##c.Putin_rating21 poldistrust21 dictatorship21 opinion17 conspment16 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16	[pweight=wei21_mz] 
		eststo dPutin_m1
	
	* Model 2
	reg Putin_rating_diff23vs21 c.Putin_rating21##c.Putin_rating21 polallienation21_st i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz] 
		eststo dPutin_m2

	* Plot
	coefplot dPutin_m1 dPutin_m2, bylabel("OLS: coefficients") ||, ///
			drop(_cons) xline(0) level(95 90) byopts(row(1) xrescale)  ///
			scheme(white_tableau) ///
			legend(order(3 "R²=0.47" 6 "R²=0.47")) ///
			order(poldistrust21 dictatorship21 opinion17 conspment16 polallienation21_st) ///
			name(FigureF4, replace)	
			
	graph export FigureF4.tif, width(1000) replace	
				
		
	
	
***** Appendix G: Distinguishing downward and upward adjustment in ratings of Putin *****
	* variable counting only upward changes
	clonevar Putin_rating_diff24vs21_up=Putin_rating_diff24vs21
	replace Putin_rating_diff24vs21_up=0 if Putin_rating_diff24vs21<0
		fre Putin_rating_diff24vs21_up
	
	* variable counting only downward changes
	clonevar Putin_rating_diff24vs21_down=Putin_rating_diff24vs21
	replace Putin_rating_diff24vs21_down=0 if Putin_rating_diff24vs21>0 & Putin_rating_diff24vs21<.	
		fre Putin_rating_diff24vs21_down
	
***** Figure G1: Regressing change in ratings of Putin between December 2021 and May 2023 on pre-invasion attitudes 
	* OLS
	
	* Up
	* Model 1
	reg Putin_rating_diff24vs21_up c.Putin_rating21##c.Putin_rating21 poldistrust21 dictatorship21 opinion17 conspment16 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz] 
		eststo dPutin_m1
	
	* Model 2
	reg Putin_rating_diff24vs21_up c.Putin_rating21##c.Putin_rating21 polallienation21_st i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz] 
		eststo dPutin_m2

	* Down
	* Model 1
	reg Putin_rating_diff24vs21_down c.Putin_rating21##c.Putin_rating21 poldistrust21 dictatorship21 opinion17 conspment16 i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz] 
		eststo dPutin_m3
	
	* Model 2
	reg Putin_rating_diff24vs21_down c.Putin_rating21##c.Putin_rating21 polallienation21_st i.gender ib2.education ib3.age_groups##i.east i.Russianspeaking anti_atlanticism21 unilateralism21 isolationism21 pacifism21 authoritarian_st ib2.leftright16 [pweight=wei21_mz] 
		eststo dPutin_m4
		
		
	* Plot
	coefplot dPutin_m1 dPutin_m2, bylabel("OLS: coefficients (upward)") || dPutin_m3 dPutin_m4, bylabel("OLS: coefficients (downward)") ||, ///
			drop(_cons) xline(0) level(95 90) byopts(row(1))  ///
			scheme(white_tableau) ///
			legend(cols(15) hole(1 2 3 4 5 6 7 8 11 12 13) order(3 "R²=0.06" 6 "R²=0.06" 3 "R²=0.56" 6 "R²=0.56")) ///
			order(poldistrust21 dictatorship21 opinion17 conspment16 polallienation21_st) ///
			name(FigureG1, replace)	
			
	graph export FigureG1.tif, width(1000) replace	